#pragma once

#include <memory>
#include "instructions/base/bytecode_reader.h"
#include "instructions/base/instructions.h"
#include "rtda/frame.h"

namespace jvm {
namespace instructions {

// Null checks
class IFNULL : public BranchInstruction {
public:
    void execute(std::shared_ptr<rtda::Frame> frame) override;
};

class IFNONNULL : public BranchInstruction {
public:
    void execute(std::shared_ptr<rtda::Frame> frame) override;
};

// Wide instruction modifier
class WIDE : public Instruction {
private:
    std::shared_ptr<Instruction> _modifiedInstruction;

public:
    void fetchOperands(std::shared_ptr<BytecodeReader> reader) override;
    void execute(std::shared_ptr<rtda::Frame> frame) override;
};

// Wide goto instruction
class GOTO_W : public Instruction {
private:
    int32_t _offset;

public:
    void fetchOperands(std::shared_ptr<BytecodeReader> reader) override;
    void execute(std::shared_ptr<rtda::Frame> frame) override;
};

} // namespace instructions
} // namespace jvm